﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XCommunity.Users;

namespace XCommunity.Forums
{
  public class UserPermission : Permission
  {

    public UserPermission( ForumsUser user, ForumsUserService service )
      : base( service )
    {
      User = user;
    }



    protected ForumsUser User
    {
      get;
      private set;
    }


    protected new ForumsUserService Service
    {
      get { return (ForumsUserService) base.Service; }
    }


    protected override IEnumerable<IControlItem> GetControlItems()
    {
      if ( User == null )
        return Enumerable.Empty<IControlItem>();

      return Service.DefinedControlGroups["NormalUsers"];
    }
  }
}
